package cn.gov.anhai.controller;

import cn.gov.anhai.service.HomeService;
import cn.gov.anhai.utils.ApiResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping(value = "/home")
@Api(tags = {"首页"})
public class HomeController {
    private Logger logger = LoggerFactory.getLogger(HomeController.class);

    @Resource
    HomeService homeService;

    /**
     * 轮播图
     */
    @GetMapping(value = "/bannerList")
    @ApiOperation(value = "轮播图")
    public ApiResult<Object> bannerList(HttpServletRequest request) throws Exception {
        return homeService.bannerList();
    }

    /**
     * 导航区
     */
    @GetMapping(value = "/navList")
    @ApiOperation(value = "导航区")
    public ApiResult<Object> navList(HttpServletRequest request) throws Exception {
        return homeService.navList();
    }

    /**
     * 景点推荐
     */
    @GetMapping(value = "/scenicList")
    @ApiOperation(value = "景点推荐")
    public ApiResult<Object> scenicList(HttpServletRequest request) throws Exception {
        return homeService.scenicList();
    }

    /**
     * 路线推荐
     */
    @GetMapping(value = "/wayList")
    @ApiOperation(value = "路线推荐")
    public ApiResult<Object> wayList(HttpServletRequest request) throws Exception {
        return homeService.wayList();
    }

    /**
     * 美食推荐
     */
    @GetMapping(value = "/delicacyFoodList")
    @ApiOperation(value = "美食推荐")
    public ApiResult<Object> delicacyFoodList(HttpServletRequest request) throws Exception {
        return homeService.delicacyFoodList();
    }

    /**
     * 酒店推荐
     */
    @GetMapping(value = "/hotelList")
    @ApiOperation(value = "酒店推荐")
    public ApiResult<Object> hotelList(HttpServletRequest request) throws Exception {
        return homeService.hotelList();
    }
}
